<@override name="title">
    <#if oper=="create">
    新建游戏奖项
    <#else>
    编辑游戏奖项
    </#if>
</@override>

<@override name="viewbody">
<div class="row">
    <div class="col-md-12">
        <h3 class="page-title">
            游戏管理
            <small>
                <#if oper=="create">
                    创建新的游戏奖项
                <#else>
                    修改已有游戏奖项
                </#if>
            </small>
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="${ctx}/admin/home">
                    首页
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="${ctx}/admin/game/awards">
                    游戏奖项
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">
                    <#if oper=="create">
                        新建游戏奖项
                    <#else>
                        编辑游戏奖项
                    </#if>
                </a>
            </li>
        </ul>
    </div>
</div>

<form class="form-horizontal" action="${ctx}/admin/game/awards/save" role="form" id="dataForm" method="post">
    <div class="panel panel-default">
        <div class="panel-heading"><h6 class="panel-title">游戏奖项信息</h6></div>
        <div class="panel-body">
            <input name="awards.id" type="hidden" value="${awards.id!}"/>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="awards.name">奖项名称: <span class="mandatory">*</span></label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" name="awards.name" id="awards.name" value="${awards.name!}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="awards.gift">赠送礼品: <span class="mandatory">*</span></label>
                <div class="col-sm-9">
                    <select data-placeholder="选择礼品" name="awards.gift" id="awards.gift"
                            class="required form-control input-xlarge select2me">
                        <option value=""></option>
                        <#if gifts??>
                            <#list gifts as item>
                                <option value="${item.id}"
                                        <#if awards.gift?? && awards.gift == item.id>selected="selected"</#if> >${item.name}</option>
                            </#list>
                        </#if>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="awards.state">永不中奖: <span class="mandatory">*</span></label>

                <div class="col-sm-9 radio-list">
                    <#if awards.state??>
                    <label class="radio-inline">
                        <input type="radio" name="awards.state" id="awards.state" value="1" ${awards.state?string('checked', '')}> 启用
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="awards.state" id="awards.state" value="0" ${awards.state?string('', 'checked')}> 不启用
                    </label>
                    <#else>
                    <label class="radio-inline">
                        <input type="radio" name="awards.state" id="awards.state" value="1"> 启用
                    </label>
                    <label class="radio-inline">
                        <input type="radio" name="awards.state" id="awards.state" value="0" checked> 不启用
                    </label>
                    </#if>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="awards.size">中奖名额: <span class="mandatory">*</span></label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" name="awards.size" id="awards.size" value="${awards.size!}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="awards.type">奖励类型: <span class="mandatory">*</span></label>
                <div class="col-sm-9">
                    <select name="awards.type" id="awards.type" class="form-control">
                        <option value="1" <#if awards.type?? && awards.type == 1>selected="selected"</#if>>游戏奖励</option>
                    </select>
                </div>
            </div>

            <#--<div class="form-group">
                <label class="col-sm-2 control-label" for="awards.integrel">积分: </label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" name="awards.integrel" id="awards.integrel" value="${awards.integrel!}">
                </div>
            </div>-->
       </div>

        <div class="form-actions text-right">
            <a class="btn default yellow-stripe" href="${ctx}/admin/game/awards">返回</a>
            <input type="submit" value="保存" class="btn btn-primary">
        </div>
    </div>
    </div>
</form>
</@override>

<@override name="viewmodule">awards_item</@override>

<@extends name="../../_basic/main.ftl"></@extends>
